package second;

import java.lang.reflect.Method;

import org.springframework.aop.AfterReturningAdvice;

/**
 * 
 * 
 * @author Wangpeihu
 * @team [Never give up]
 * @since JDK1.6(建议)
 * @date 2010-2-8
 */
public class ValidateAdvice implements AfterReturningAdvice {
	/**
	 * 方法后，多了返回值
	 */
	@Override
	public void afterReturning(Object returnValue, Method method,
			Object[] args, Object target) throws Throwable {
		System.out.println("----------------这里是调用后--------------------");
		System.out.println("调用了afterReturning");
		System.out.println("不知道是什么对象:" + args.toString());
		System.out.println("目标对象：target:" + target.getClass());
		System.out.println("返回结果：returnValue:" + returnValue.toString());
		System.out.println("-----------------这里是调用后------------------");

		boolean success = (Boolean) returnValue;
		if (success) {
			if (target instanceof StoreService) {
				StoreService she = (StoreService) target;
				System.out.println(she.toString());
				System.out.println("dOK");
			}
		}

	}
}
